*********************************
***  Turkey paper - Data anlaysis - APPENDIX
*** Created: 13/12/2021
*** Last updated: 06/08/2024 in Stata 18
clear all
*use main dataset

*** DEFINING GLOBALS


global items_all cn_ottoman_1  pride_national pride_religious ci_lifequality strongleader limitedelections rn_media_1 trust_religiousauthority trust_elections trust_presidentialsystem trust_parliament trust_military an_akpstate_1 an_erdoganmission_1 an_erdoganinspiring_1 an_akpmuslims_1 success_economyminister success_erdogan  policy_economy policy_povertyreduction policy_internalsecurity

global items_reducedTrust cn_ottoman_1  pride_national pride_religious ci_lifequality strongleader limitedelections rn_media_1 trust_religiousauthority trust_elections trust_presidentialsystem an_akpstate_1 an_erdoganmission_1 an_erdoganinspiring_1 an_akpmuslims_1 success_economyminister success_erdogan  policy_economy policy_povertyreduction policy_internalsecurity

global itemsnotrust cn_ottoman_1  pride_national pride_religious ci_lifequality strongleader limitedelections rn_media_1 an_akpstate_1 an_erdoganmission_1 an_erdoganinspiring_1 an_akpmuslims_1 success_economyminister success_erdogan  policy_economy policy_povertyreduction policy_internalsecurity

global normative cn_ottoman_1  pride_national pride_religious strongleader limitedelections rn_media_1 an_akpstate_1 an_erdoganmission_1 an_erdoganinspiring_1 an_akpmuslims_1

global instrumental ci_lifequality success_economyminister success_erdogan policy_economy policy_povertyreduction policy_internalsecurity


global support normative instrumental itemsnotrust
global support2 normative2 instrumental


global controls age female i.educ_cat interest partisan i.religious i.urban_dum income econ_change

global outcomes likel_voteforregime likel_abstain likel_opposition1 likel_opposition2  mobilizationforakp
global outcomes2 likel_voteforregime likel_abstain likel_opposition1 likel_opposition2  

global blame blame_erdogan blame_economyministers blame_centralbank blame_externalfactors



**---------------------------------
** Appendix 3: Table A.1 Comparing sample characteristics with 2020 Census Data

tab region
tab region [aweight=weight]
tab agegroup
tab agegroup [aweight=weight]
tab gender
tab gender [aweight=weight]
tab educ_cat
tab educ_cat [aweight=weight]
tab notvoted
tab notvoted [aweight=weight]
tab vote_2018 if notvoted==0 
tab vote_2018 if notvoted==0 [aweight=weight]

**---------------------------------
** Appendix 4.1.3 Explorative factor analysis of political support items 
* Table A.2

factor $items_notrust if regimevoter==1 [aweight=weight], pcf mineig(1)
factor $items_notrust if regimevoter==0 [aweight=weight], pcf mineig(1)
pwcorr regimevoter $items_notrust

*Table A.3 
factor $items_all if regimevoter==1 [aweight=weight], pcf mineig(1)
factor $items_all if regimevoter==0 [aweight=weight], pcf mineig(1)
pwcorr regimevoter $items_all


**---------------------------------
** Appendix 5.1. List experiment

*Figure A1 prepared in R

** Appendix 5.2. Results of list experiment using different ways to measure middle category
*Table A.4

tab1 cn_ottoman_1 rn_media_1 an_erdoganinspiring_1 if study==2 & regimevoter==1 [aweight=weight] 

* Observed: Setting neutral (=3) to not agree
recode cn_ottoman_1 (1/3=0)(4/5=1), gen(cn_ottoman_dum)
recode rn_media_1 (1/3=0)(4/5=1), gen(rn_media_dum)
recode an_erdoganinspiring_1 (1/3=0)(4/5=1), gen(can_erdoganinspiring_dum)

* Observed: Setting neutral (=3) to missing
recode cn_ottoman_1 (1/2=0)(4/5=1)(3=.), gen(cn_ottoman_dum2)
recode rn_media_1 (1/2=0)(4/5=1)(3=.), gen(rn_media_dum2)
recode an_erdoganinspiring_1 (1/2=0)(4/5=1)(3=.), gen(can_erdoganinspiring_dum2)

* Observed: Setting neutral (=3) to agree
recode cn_ottoman_1 (1/2=0)(3/5=1), gen(cn_ottoman_dum3)
recode rn_media_1 (1/2=0)(3/5=1), gen(rn_media_dum3)
recode an_erdoganinspiring_1 (1/2=0)(3/5=1), gen(can_erdoganinspiring_dum3)

tab1 cn_ottoman_dum cn_ottoman_dum2,m
tab1 cn_ottoman_dum cn_ottoman_dum2

sum cn_ottoman_dum rn_media_dum can_erdoganinspiring_dum cn_ottoman_dum2 rn_media_dum2 can_erdoganinspiring_dum2 cn_ottoman_dum3 rn_media_dum3 can_erdoganinspiring_dum3 if study==2 [aweight=weight]
bys regimevoter: sum cn_ottoman_dum rn_media_dum can_erdoganinspiring_dum cn_ottoman_dum2 rn_media_dum2 can_erdoganinspiring_dum2 cn_ottoman_dum3 rn_media_dum3 can_erdoganinspiring_dum3 if study==2 [aweight=weight]

* List results

tab list_regi_full
codebook list_regi_full

sum   list_comm_cont list_comm_full list_regi_cont list_regi_full list_auth_cont list_auth_full [aweight=weight]
bys regimevoter: sum list_comm_cont list_comm_full list_regi_cont list_regi_full  list_auth_cont list_auth_full [aweight=weight]



**---------------------------------
** Appendix 6. Table A.5: Balance test 

tab treatment study

capture erase "${results}Results_balance.xls"
capture erase "${results}Results_balance.txt"

logit treatment $controls if study==1
		estimates store M1_all
outreg2  using "${results}Results_balance.xls", ///
bracket bdec(3) sdec(3) append

logit treatment $controls if regimevoter==1 & study==1
		estimates store M1_regime
outreg2  using "${results}Results_balance.xls", ///
bracket bdec(3) sdec(3) append

logit treatment $controls if regimevoter==0 & study==1
		estimates store M1_regime
outreg2  using "${results}Results_balance.xls", ///
bracket bdec(3) sdec(3) append

logit treatment $controls if study==2
		estimates store M2_all
outreg2  using "${results}Results_balance.xls", ///
bracket bdec(3) sdec(3) append

logit treatment $controls if regimevoter==1 & study==2
		estimates store M2_regime
outreg2  using "${results}Results_balance.xls", ///
bracket bdec(3) sdec(3) append

logit treatment $controls if regimevoter==0 & study==2
		estimates store M2_regime
outreg2  using "${results}Results_balance.xls", ///
bracket bdec(3) sdec(3) append


**---------------------------------
*Appendix A7. Table A.6  Impact of crisis treatment on autocratic system support: Regression coefficients and 95% confidence intervals.

tab study regimevoter

*Testing Hypothesis 4: While instrumental forms of support shift in response to information about negative policy performance, normative forms of support do not. 

capture erase "${results}Results_h4.xls"
capture erase "${results}Results_h4.txt"

foreach k of varlist $support  {

reg `k' treatment if study==1 & regimevoter==1
estimates store `k'
outreg2  using "${results}Results_h4.xls", ///
bracket bdec(3) sdec(3) append


}

** Opposition
foreach k of varlist $support  {

reg `k' treatment if study==1 & regimevoter==0
estimates store `k'
outreg2  using "${results}Results_h4.xls", ///
bracket bdec(3) sdec(3) append


}

**************************************
**************************************

** Appendix 7 Table A7  Impact of crisis treatment on vote likelihood and AKP mobilization: Regression coefficients and 95% confidence intervals.

capture erase "${results}Results_h5_1.xls"
capture erase "${results}Results_h5_1.txt"

sum $outcomes, d

foreach k of varlist $outcomes {

reg `k' treatment income if study==2 & regimevoter==1 
estimates store `k'
outreg2  using "${results}Results_h5_1.xls", ///
bracket bdec(3) sdec(3) append

}

foreach k of varlist $outcomes2 {

reg `k' treatment if study==2 & regimevoter==0
estimates store `k'
outreg2  using "${results}Results_h5_1.xls", ///
bracket bdec(3) sdec(3) append

}

** Appendix 7 Table A.8 (Figure 5: Interaction between economic crisis treatment and system support on likelihood to vote for government parties. Marginal effects and 95% confidence intervals. Government voters only!)


reg likel_voteforregime i.treatment##c.normative income if study==2 & regimevoter==1
estimates store norm
outreg2  using "${results}Results_h4_2.xls", ///
bracket bdec(3) sdec(3) append


* Instrumental
reg likel_voteforregime i.treatment##c.instrumental income if study==2 & regimevoter==1
estimates store inst
outreg2  using "${results}Results_h4_2.xls", ///
bracket bdec(3) sdec(3) append




**---------------------------------
** Appendix A8 Figure A2: Results H1: Single survey items for regime support


** Single items instead of index
capture erase "${results}Results_h4_items.xls"
capture erase "${results}Results_h4_items.txt"

sum $instrumental $normative

foreach k of varlist  $instrumental $normative {

reg `k' treatment if study==1 & regimevoter==1 
estimates store `k'
outreg2  using "${results}Results_h4_items.xls", ///
bracket bdec(3) sdec(3) append
}

coefplot $normative, drop (_cons) xline (0) scheme(plotplain) title("Normative Support Items", size(medium)) name(h3_norm, replace)

coefplot $instrumental, drop (_cons) xline (0) scheme(plotplain) title("Instrumental Support Items", size(medium)) name(h3_inst, replace)

graph combine h3_norm h3_inst,col(1) xsize(8) ysize(10)


**---------------------------------
** Appendix 9. Results H2: Vote change variable as outcome

capture erase "${results}Results_h5_vote.xls"
capture erase "${results}Results_h5_vote.txt"

*Table A.9
tab likel_categories [aweight=weight] if study==2

*Table A.10
mlogit likel_categories treatment  if study==2
estimates store likel_categories
outreg2  using "${results}Results_h5_vote.xls", ///
bracket bdec(3) sdec(3) append


**---------------------------------
** Appendix 10. Single survey items for pro-government behavioural support: Interaction between treatment and system support

*Figure A3

foreach k of varlist $items_notrust {

reg likel_voteforregime i.treatment##c.`k' income if study==2 & regimevoter==1 
estimates store `k'

margins, dydx(treatment) at(`k' =(0(1)5)) vsquish 
marginsplot, yline(0)  xtitle("`k'", size(medsmall)) ylabel(-2.5(0.5)0.5) xlabel(, nolabel)  title("`k'", size(large)) name(`k', replace)

}

graph combine $items_notrust



**---------------------------------
** Appendix 11. Conditional of economic treatment on mobilization for AKP by of system support

capture erase "${results}Results_h4_3.xls"
capture erase "${results}Results_h4_3.txt"

*Figure A.4
foreach k of varlist $support {

reg mobilizationforakp i.treatment##c.`k' income if study==2 & regimevoter==1, cluster(region) 
estimates store `k'
outreg2  using "${results}Results_h4_3.xls", ///
bracket bdec(3) sdec(3) append

margins, dydx(treatment) at(`k' =(0(10)100)) vsquish 
marginsplot, yline(0) ylabel(-1.5(.5)1) xtitle("`k'", size(medsmall)) title("`k'", size(medlarge)) name(`k', replace)

}

graph combine $support, row(1)


*----------------------------------------------------------------------------------

*Appendix 12 - Figure A.5

*FOR NORMATIVE

** Interaction between economic crisis treatment and normative support on blame assigned for poor economic performance. Marginal effects and 95% confidence intervals. Government voters only!
 
  foreach k of varlist $blame {
 
  
reg `k'  i.treatment##c.normative income if study==2 & regimevoter==1 
estimates store `k'
margins, dydx(treatment) at(normative =(0(10)100)) vsquish 
marginsplot, yline(0)  xtitle("Normative support", size(medsmall)) ylabel(-1(0.5)1)  title("`k'", size(medlarge)) name(`k', replace)

}

graph combine $blame

  

**Mediation analysis: Blame attribution and economic crisis treatment on vote for governingparties
*Table A.11

sum normative if regimevoter==1 & study==2, d
*77.5 is the median
ssc install mediation
medeff (regress blame_erdogan treatment income) (regress likel_voteforregime treatment blame_erdogan income) if regimevoter==1 & study==2 & normative<77.5, treat(treatment) mediate(blame_erdogan) 

medeff (regress blame_erdogan treatment income) (regress likel_voteforregime treatment blame_erdogan income) if regimevoter==1 & study==2 & normative>77.5, treat(treatment) mediate(blame_erdogan) 


*Table A.12


medeff (regress blame_externalfactors treatment income) (regress likel_voteforregime treatment blame_externalfactors income) if regimevoter==1 & study==2 & normative<77.5, treat(treatment) mediate(blame_externalfactors) 

medeff (regress blame_externalfactors treatment income) (regress likel_voteforregime treatment blame_externalfactors income) if regimevoter==1 & study==2 & normative>77.5, treat(treatment) mediate(blame_externalfactors) 

	*FOR INSTRUMENTAL
  
  *Figure A.6
  
   foreach k of varlist $blame {
 
  
reg `k'  i.treatment##c.instrumental income if study==2 & regimevoter==1 
estimates store `k'
margins, dydx(treatment) at(instrumental =(0(10)100)) vsquish 
marginsplot, yline(0)  xtitle("Instrumental Support", size(medsmall)) ylabel(-1(0.5)1)  title("`: var label `k''", size(medlarge)) name(`k', replace) scheme (plotplain)

}

graph combine $blame

  
*Table A.13


  sum instrumental if regimevoter==1 & study==2, d
* 65 is the median

medeff (regress blame_erdogan treatment income) (regress likel_voteforregime treatment blame_erdogan income) if regimevoter==1 & study==2 & instrumental<65, treat(treatment) mediate(blame_erdogan) 
medeff (regress blame_erdogan treatment income) (regress likel_voteforregime treatment blame_erdogan income) if regimevoter==1 & study==2 & instrumental>65, treat(treatment) mediate(blame_erdogan) 

*Table A.14

medeff (regress blame_externalfactors treatment income) (regress likel_voteforregime treatment blame_externalfactors income) if regimevoter==1 & study==2 & instrumental<65, treat(treatment) mediate(blame_externalfactors) 

medeff (regress blame_externalfactors treatment income) (regress likel_voteforregime treatment blame_externalfactors income) if regimevoter==1 & study==2 & instrumental>65, treat(treatment) mediate(blame_externalfactors) 

  
 *----------------------------------------------------------------------------------

** Appendix 13  Robustness tests dropping pride items from normative index
*Figure A7
** Testing H1

foreach k of varlist normative2  normative3 {

reg `k' treatment if study==1 & regimevoter==1
estimates store gov_`k'

reg `k' treatment if study==1 & regimevoter==0
estimates store opp_`k'

coefplot gov_`k' opp_`k', drop (_cons) xline (0) scheme(plotplain)  legend(lab(2 "Government voters") lab(4 "Non-Government voters") size(medium)  region(lcolor(white)) order(2 4 6 8 10 12)) ylabel(,labsize(medium)) xlabel(-6(2)4) title(`k', size(large)) name(`k', replace)

}

graph combine normative2  normative3 , row(2) // change titles of sub-graphs manually

// Normative2: "Normative support - without pride variables"
// Normative3: "Normative support - without AKP and Erdogan variables"


* Testing H2a

* Normative
*Figure A8
foreach k of varlist normative2  normative3 {
reg likel_voteforregime i.treatment##c.`k' income if study==2 & regimevoter==1
estimates store norm

margins, dydx(treatment) at(`k' =(0(10)100)) vsquish 
marginsplot, yline(0) ylabel(-2(0.5)0.5) xtitle("Alternative normative support", size(medium)) name(`k', replace)  ylabel(, labsize(medsmall)) xlabel(, labsize(medsmall)) ytitle(, size(medium)) title("`k'", size(large))
}

graph combine normative2  normative3 , row(2) // change titles of sub-graphs manually

// Normative2: "Normative support - without pride variables"
// Normative3: "Normative support - without AKP and Erdogan variables"






**---------------------------------
** Appendix 14 - Figure A9 - Treatment Effects on Economic Assessments

sum econ_change if regimevoter==1
sum econ_change if oppositionvoter==1
sum econ_change if notvoted==1

sum change_personal

// Are vote and partisanship the same?
tab pid_AKP regimevoter, row


capture erase "${results}Results_econ_change.xls"
capture erase "${results}Results_econ_change.txt"

regress change_personal treatment, cluster(region) 
		estimates store Sample_All
outreg2  using "${results}Results_econ_change.xls", ///
bracket bdec(3) sdec(3) append

regress change_personal treatment  if regimevoter==1 , cluster(region)
		estimates store Sample_Government_Voters
outreg2  using "${results}Results_econ_change.xls", ///
bracket bdec(3) sdec(3) append

regress change_personal treatment  if oppositionvoter==1, cluster(region)
		estimates store Sample_Opposition_Voters
outreg2  using "${results}Results_econ_change.xls", ///
bracket bdec(3) sdec(3) append

regress change_personal treatment  if notvoted==1, cluster(region)
		estimates store Sample_No_Voters
outreg2  using "${results}Results_econ_change.xls", ///
bracket bdec(3) sdec(3) append

coefplot Sample_All Sample_Government_Voters Sample_Opposition_Voters Sample_No_Voters, drop (_cons) xline (0) scheme(plotplain) 


**---------------------------------
** Appendix 15. Perceptual screen of regime support on economic evaluations
*Figure A10

** Normative support (like partisanship) colours economic assessments
tab econ_change 
tab econ_change, nolabel 

** Governing voters
ologit econ_change instrumental age female  interest urban_dum income if study==2 & regimevoter==1, cluster(region) 
estimates store M_inst

ologit econ_change normative age female  interest urban_dum income if study==2 & regimevoter==1, cluster(region) 
estimates store M_norm

ologit econ_change normative age female  interest pid_AKP urban_dum income if study==2  &regimevoter==1, cluster(region) 
estimates store M_norm2


coefplot M_inst M_norm M_norm2, drop (_cons age female  interest pid_AKP urban_dum income) xlabel(-0.02(0.02).12) xline (0) scheme(plotplain)  legend(lab(4 "M2: Normative Support") lab(6 "M3: Normative Support + AKP pid") lab(2 "M1: Instrumental Support") size(medium)  region(lcolor(white)) order(2 4 6 8 10 12)) name(econeval_gov, replace) title("Government voters", size(large))ylabel(,labsize(medium))

** Non-Government voters
ologit econ_change instrumental age female  interest urban_dum income if study==2 & regimevoter==0, cluster(region) 
estimates store M_inst

ologit econ_change normative age female  interest urban_dum income if study==2 & regimevoter==0, cluster(region) 
estimates store M_norm

ologit econ_change normative age female  interest pid_AKP urban_dum income if study==2  &regimevoter==0, cluster(region) 
estimates store M_norm2


coefplot M_inst M_norm M_norm2, drop (_cons age female  interest pid_AKP urban_dum income) xlabel(-0.02(0.02).12) xline (0) scheme(plotplain)  legend(lab(4 "M2: Normative Support") lab(6 "M3: Normative Support + AKP pid") lab(2 "M1: Instrumental Support") size(medium)  region(lcolor(white)) order(2 4 6 8 10 12)) name(econeval_nogov, replace) title("Non-Government voters", size(large))ylabel(,labsize(medium))


graph combine econeval_gov econeval_nogov, col(1)


**---------------------------------
** Appendix 16. Divergences to Registration

*Table A.15

* H1: Level of support
sum $objects [aweight=weight] if study==2
sum $objects [aweight=weight] if study==2 & regimevoter==1 
sum $objects [aweight=weight] if study==2 & oppositionvoter==1 
sum $objects [aweight=weight] if study==2 & notvoted==1 


* H3b: Hierachy of objects and impact of treatment##c
** Testing H1

*Figure A.11
sum $objects

foreach k of varlist $objects  {
reg `k' treatment if study==1 & regimevoter==1
estimates store `k'
}

coefplot $objects, drop (_cons) xline (0) scheme(plotplain)  legend(lab(2 "Community: Pride") lab(4 "Community: Regime") lab(6 "Regime") lab(8 "Authority") size(medium)  region(lcolor(white)) order(2 4 6 8 10 12)) name(h4_gov, replace) title("Government voters", size(large))ylabel(,labsize(medium)) xlabel(-6(2)8)


foreach k of varlist $objects  {
reg `k' treatment if study==1 & regimevoter==0
estimates store `k'
}

coefplot $objects, drop (_cons) xline (0) scheme(plotplain)  legend(lab(2 "Community: Pride") lab(4 "Community: Regime") lab(6 "Regime") lab(8 "Authority") size(medium)  region(lcolor(white)) order(2 4 6 8 10 12)) name(h4_opp, replace) title("Non-Government voters", size(large))ylabel(,labsize(medium)) xlabel(-6(2)8)

graph combine h4_gov h4_opp, col(1)

* H4c+d: Interaction effects

*Figure A.12
foreach k of varlist $objects  {
reg likel_voteforregime i.treatment##c.`k' income if study==2 & regimevoter==1

margins, dydx(treatment) at(`k' =(0(10)100)) vsquish 
marginsplot, yline(0) ylabel(-1.5(0.5)0.5) xtitle("`k'", size(medium)) title("`k'", size(large)) name(`k', replace)  ylabel(, labsize(medium)) xlabel(, labsize(medium)) ytitle(, size(medium))
}


graph combine community_proud community_regime regime authority, xsize(7) ysize(5)

** results political trust

*Figure A.13

** Testing H1

foreach k of varlist trust  {

reg `k' treatment if study==1 & regimevoter==1
estimates store gov

reg `k' treatment if study==1 & regimevoter==0
estimates store opp


}

coefplot gov opp, drop (_cons) xline (0) scheme(plotplain)  legend(lab(2 "Government voters") lab(4 "Non-Government voters") size(medium)  region(lcolor(white)) order(2 4 6 8 10 12)) name(h4_gov, replace) ylabel(,labsize(medium)) xlabel(-6(2)4)



*Figure A.14

* Testing H2a

* Normative
reg likel_voteforregime i.treatment##c.trust income if study==2 & regimevoter==1
estimates store norm

margins, dydx(treatment) at(trust =(0(10)100)) vsquish 
marginsplot, yline(0) ylabel(-1.5(0.5)0.5) xtitle("Political trust", size(medium)) ylabel(, labsize(medsmall)) xlabel(, labsize(medsmall)) ytitle(, size(medium)) title(" ")


**---------------------------------
** Appendix 17. Distribution of Variables in Representative Survey

*Figure A15
*USE CSES dataset

twoway(kdensity economyworse  [aweight=weight] if akpvoter==1),  xlabel(1 "Much better" 2"Better" 3 "Same" 4"Worse" 5 "Much Worse") xscale(range(5.15)) name(kernel1, replace) ytitle("Kernel density", size(medsmall)) xtitle("Eval. of the State of Economy over the Last Year", size(medlarge)) 

twoway(kdensity feeling_akp  [aweight=weight] if akpvoter==1),  xlabel(0 "Strong dislike" 1 "" 2"" 3 "" 4"" 5 "" 6 "" 7"" 8 "" 9"" 10 "Strong like") xscale(range(10.15)) name(kernel2, replace) ytitle("Kernel density", size(medsmall)) xtitle("Feeling Thermometer for AKP", size(medlarge)) 

graph combine kernel1 kernel2, title("Distributions for AKP voters, CSES 2018", size(large))

